package com.it.spirngbootmybatis.util;

public class ResultUtil {
    public static final Integer SUCCESS=0;//成功
    public static final Integer FAIL=1;
    private Integer code;
    //提示信息
    private String msg;
    //返回的数据
    private Object obj;

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Object getObj() {
        return obj;
    }

    public void setObj(Object obj) {
        this.obj = obj;
    }
    public ResultUtil() {

    }
    public ResultUtil(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }
    public ResultUtil(Integer code, String msg, Object obj) {
        this.code = code;
        this.msg = msg;
        this.obj = obj;
    }
    //    登录成功
    public static ResultUtil success(Integer code, String msg, Object obj){
        return new ResultUtil(code,msg,obj);
    }
    public static ResultUtil fail(Integer code, String msg){
        return new ResultUtil( code, msg);
    }
}
